<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html class=" -webkit-">
	<head>
		
	<meta charset="utf-8">
    <title>杰利联合</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
	<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <link rel="stylesheet" type="text/css" href="${ctxStatic}/jiu/css/mobile_module.css?v=1492659303" media="all">
   
    <script type="text/javascript" src="${ctxStatic}/jiu/js/jquery-2.0.3.min.js"></script>
	<link rel="stylesheet" href="${ctxStatic}/jiu/css/chongzhi.css">
    <link href="${ctxStatic}/jiu/css/common.css?v=1492659303" rel="stylesheet" type="text/css">
	<script>
			$(function() {
				$(".chzh_list li").click(function() {
					$(".chzh_list li").removeClass("chzh_active");
					$(this).addClass("chzh_active");
				})
			})
		</script>
		<style>
			.hearder{
				height: 50px;
				background-color: #30B0F3;
				width: 100%;
				text-align: center;
				color: white;
				font-size: 20px;
                line-height:50px;
                position: fixed;
			    top: 0;
			    z-index: 1;
			}
			.chongzhi{
				position: relative;
			    padding: 10px;
			    background-color: #FFFFFF;
			    border-bottom: 1px #eee solid;
			}
			.chongzhi h1 {
			    font-style: normal;
			    
			    font-size: 18px;
			    font-weight: normal;
			}
			.chongzhi p{
				font-size: 14px;
    			color: #999999;
			}
			.chongzhi .p2{
				font-size: 14px;
    			color: #999999;
    			text-align: right;
    			padding-top: 3px;
			}
			.chongzhi span{			
			    font-size: 16px;
			    color: #eb4f38;
			    text-align: right;
			}
			.btns{						
			   position: relative;
			   display: block;
			    margin-left: auto;
			    margin-right: auto;
			    padding-left: 14px;
			    padding-right: 14px;
			    box-sizing: border-box;
			    font-size: 18px;
			    text-align: center;
			    text-decoration: none;			   
			    line-height: 2.33333333;
			    border-radius: 5px;
			  
			    overflow: hidden;
			    margin: 1.17647059em 15px 0.3em;
			    background-color: #30B0F3;
			    	}
			.btns1{						
			   position: relative;
			   display: block;
			    margin-left: auto;
			    margin-right: auto;
			    padding-left: 14px;
			    padding-right: 14px;
			    box-sizing: border-box;
			    font-size: 18px;
			    text-align: center;
			    text-decoration: none;			   
			    line-height: 2.33333333;
			    border-radius: 5px;
			  
			    overflow: hidden;
			    margin: 1.17647059em 15px 0.3em;
			    background-color: #cccccc;
			    	}
			    	.bt{						
			   position: relative;
			    display: block;
			    margin-left: auto;
			    margin-right: auto;
			    padding-left: 14px;
			    padding-right: 14px;
			    box-sizing: border-box;
			    font-size: 12px;
			    text-align: center;
			    text-decoration: none;
			    line-height: 25px;
			    border-radius: 15px;
			    overflow: hidden;			  
			    border: 1px solid #30b0f3;
			    color: #30b0f3;
			    	}
			    	
			    /*弹层*/
			
			#dialogBg {
				width: 100%;
				height: 100%;
				background-color: #000000;
				opacity: .5;
				filter: alpha(opacity=.8);
				position: fixed;
				top: 0;
				left: 0;
				z-index: 9999;
				display: none;
			}
			
			#tanmu {
				width: 300px;
				height: 200px;
				display: none;
				background-color: #ffffff;
				position: fixed;
				top: 50%;
				left: 50%;
				margin: -100px 0 0 -150px;
				z-index: 10000;
				border: 1px solid #ccc;
				border-radius: 5px;
				-webkit-border-radius: 5px;
				/*box-shadow: 3px 2px 4px rgba(0, 0, 0, 0.2);
				-webkit-box-shadow: 3px 2px 4px rgba(0, 0, 0, 0.2);*/
				text-align: center;
			}
			
			.dialogTop {
				width: 90%;
                margin: 0 auto;
				border-bottom: 1px dotted #ccc;
				letter-spacing: 1px;
				text-align: center;
				font-size: 24px;
				color: #222222;
				margin-top: -5px;
				margin-right: 10px;
                padding: 3px 0;
			}
			.queren{	
				margin-top: 25px;
				margin-left: 35px;			
				box-sizing: border-box;
			    font-size: 16px;
			    text-align: center;
			    text-decoration: none;
			    border-radius: 3px;
			    overflow: hidden;
			    width: 90px;
			    background-color: #30B0F3;
			    height: 35px;
			    line-height: 0px;
			    float: left;
			}
			.fanhui{	
				margin-top: 25px;
				margin-right: 35px;			
				box-sizing: border-box;
			    font-size: 16px;
			    text-align: center;
			    text-decoration: none;
			    border-radius: 3px;
			    overflow: hidden;
			    width: 90px;
			    background-color: #B5B4B3;
			    height: 35px;
			    line-height: 0px;
			    float: right;
			}
			
			.chzh_list li{
			display: inline-block;
			width: 28%;
			border: 1px #DDDCDC solid;
			margin: 10px 1.5%;
			text-align: center;
			height: 45px;
		}
		</style>
</head>
<body>
	<header  class="hearder" style="">
			<a href="javascript:window.history.go(-1);">
				<img src="${ctxStatic}/jiu/img/fanhui.png" style="height: 20px;color: white;top:15px;position: absolute;left: 10px;"/></a>
			提现
	</header>
	
	<div style="margin-top: 65px;text-align: center;font-size: 15px;color: #999999;margin-left: 40px;margin-right: 40px;">
		<c:choose>
		    <c:when test="${empty jiuStore.tiRealName}">
		       	请联系管理员，先绑定提现账户
		    </c:when>
		    <c:otherwise>
			提现到${jiuStore.tiMemberName} &nbsp;&nbsp;&nbsp;&nbsp;${jiuStore.openingBank}<br />${jiuStore.bankCardNumber}
		    </c:otherwise>
		</c:choose>
	</div>
	
	<div style="background-color: white;padding: 10px;margin-top: 15px;height: 25px;">
		<div style="float: left;line-height: 25px;">
			可提现金额(元)
		</div>
		<div style="float: right;color: #30B0F3;line-height: 25px;">
			${money}
		</div>
		
	</div>
	<div style="clear: both;margin-top: 10px;">
			
	</div>
	<div style="background-color: white;padding: 10px;margin-top: 10px;height: 25px;">
		<div style="float: left;line-height: 25px;">
			提现金额		
		</div>
		<div style="float: left;line-height: 25px;">
			<input type="text" placeholder="请输入提现金额" style="height: 20px;border: none;text-align: center;" id="money"/>
		</div>
		<div style="float: right;">		
			       <div class="bt" onclick="quan()">全额</div>					
		</div>
		<div style="clear: both;"></div>
	</div> 
	
	
	<%-- <div style="clear: both;margin-top: 10px;">
		</div>
		<div style="background-color: white;padding: 10px;margin-top: 10px;height: 200px;">
			<div style="border-bottom: 1px solid #dfdfdf;padding-bottom: 10px;">
				选择以下金额提现:
			</div>
			<ul class="chzh_list" style="margin-top: 10px;">
			
				<c:forEach items="${jiuTiXianConfigList}" var="jiuTiXianConfig" varStatus="vstatus">
						<li id="c${vstatus.index}" onclick="ff(${jiuTiXianConfig.money},${jiuTiXianConfig.id})" class="${vstatus.index eq 0?'chzh_active':''}">
							<div style="line-height: 22px;">
							   ${jiuTiXianConfig.money}</br>${jiuTiXianConfig.point}积分
							</div>
						</li>
				</c:forEach>
			</ul>			
		</div> --%>
		
		
		
	 <div class="" style="margin-top: 40px;">
				<div style="margin: 10px 15px 10px;">
					<c:choose>
					    <c:when test="${empty jiuStore.tiRealName}">
					       <a  class="btns1" style="color: white;">提交</a>
					    </c:when>
					    <c:otherwise>
							<a  class="btns" style="color: white;">提交</a>
					    </c:otherwise>
					</c:choose>
					
				</div>
	</div>
	<div style="text-align: center;color: red;margin: 10px 25px 10px;font-size:18px;">
		注:每周一18点前可提现一次，周二到账，为防止恶意套现，提现不能低于5000元，敬请谅解。
	</div>
	<!--弹层-->
		<div id="dialogBg">
		</div>
		<div id="tanmu" class="">
			<div class="dialogTop">
				<span style="font-size: 19px;text-align: center;">温馨提示</span>
				<a href="javascript:;" class="closeDialog"><span style="color: #797978;float: right;">×</span></a>
			</div>
			 <div style="padding:30px 10px 10px 10px;color:red;font-size:18px;">本次提现会收取您<span id="fei">10%</span>的服务费<br />并且此操作无法撤销</div>
			 <div >
			 	<button class="queren" onclick="submit()">继续提现</button>
			 	<button class="fanhui">返回</button>
			 </div>
		</div>
	
	<script>
	 window.alert = function(name){  
         var iframe = document.createElement("IFRAME");  
         iframe.style.display="none";  
         iframe.setAttribute("src", 'data:text/plain,');  
         document.documentElement.appendChild(iframe);  
         window.frames[0].window.alert(name);  
         iframe.parentNode.removeChild(iframe);  
     } 
		function quan(){
			$('#money').val("${money}");
		}
		
		var tag=0;
		function submit(){
			
			if(tag==1){
				return false;
			}
			var money = $("#money").val();
			
			if(money == ""){
				alert("请输入提现金额");
			}else{
				if(money <= 5000){
					alert("提现金额不能低于5000元");
				}else{
					if(vailNumber(money)){
						$.getJSON("${ctxFront }/jiu/ajaxWithdrawals",{money:money}, function(data){
							tag = 1;
			                alert(data.message);
			                if(data.msg=='success'){
			                	window.location.href="${ctxFront }/jiu/withdrawalsLog?uid=${jiuStore.userId}&v="+Math.random();
			                }
			               
			            });
					}
				}
				
			}
			
		}
		 //验证提现金额     1、1.5、2、3、3.5
		 function vailNumber(money) {  
            var f = parseFloat(money);  
            if (isNaN(f)) {
            	alert("提现金额格式错误");
                return false;  
            }  
            var dot = money.indexOf(".");
            if(dot != -1){
                var dotCnt = money.substring(dot+1,money.lenght);
                if(parseFloat("0."+dotCnt) == 0.5){
                   return true;
                }else if(parseFloat("0."+dotCnt) == 0){
                   return true;
                }else{
                	alert("小数必须以5结尾");
                	return false;
                }
            }else{
            	return true;
            }
            
           /*  var f = Math.round(money*10)/10;  
            var s = f.toString();  
            var rs = s.indexOf('.');  
          
            if (rs < 0) {  
                rs = s.length;  
                s += '.';  
            }   */
         	
            return s;  
        }  
	</script>
	<script>
	
		var money="${firstTiXianConfig.money}";
		var cId="${firstTiXianConfig.id}";
		function ff(m,id){
			money=m;
			cId=id;
			
		}
			
	
			$(document).ready(function() {
				$('.btns').click(function() {
					var money = $("#money").val();
					
					if(money == ""){
						alert("请输入提现金额");
					}else{
						if(money <= 5000){
							alert("提现金额不能低于5000元");
						}else{
							if(vailNumber(money)){
								$('#tanmu').fadeIn();
								$('#dialogBg').fadeIn(300);
							}
						}
						
					}
					
				})
			});
			$(document).ready(function() {
				$('.closeDialog').click(function() {
					$('#dialogBg').fadeOut();
					$('#tanmu').fadeOut();
				});
				$('#dialogBg').click(function() {
					$('#dialogBg').fadeOut();
					$('#tanmu').fadeOut();
				});
				$('.fanhui').click(function() {
					$('#dialogBg').fadeOut();
					$('#tanmu').fadeOut();
				});
			})
		</script>
</body>
</html>